#include<stdio.h>
#include<stdlib.h>
#include<time.h>

int a, b, sum, result;
int count = 0;
int Score = 0;
int mis = 0;
int flag;
int score;
int main()
{
	
	do {
		srand(time(NULL));
		a = rand() % 10 + 1;
		b = rand() % 10 + 1;
		flag = rand() % 4 + 1;
		printf("%d",a);
		
		switch (flag)
		{
		case 1:printf("+"); sum = a + b; break;
		case 2:printf("-"); sum = a - b; break;
		case 3:printf("*"); sum = a * b; break;
		case 4:printf("/"); sum = a / b; break;
		}
		

		printf("%d=", b);
		
		scanf("%d", &result);
		printf("%d\n", result);
		if (result == sum)
		{
			printf("Right!\n");
			score = 1;
		}
		else
		{
			printf("Not correct!\n");
			score = 0;
			mis += 1;
		}
		Score += score;
		count++;
		
	} while (count < 10);
	printf("Your score is %d\n", Score);
	printf("You made %d mistake(s)",mis);

}
